package com.hrm.salarys.service;

import com.hrm.domain.salarys.Settings;
import com.hrm.salarys.dao.SettingsDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Optional;

@Service
public class SettingsService {

    @Autowired
    private SettingsDao settingsDao;

    public Settings findById(String companyId) {
        Optional<Settings> opt = settingsDao.findById(companyId);
        return opt.orElse(null);
    }

    public void saveSettings(Settings settings) {
        settingsDao.save(settings);
    }
}
